#include <QtGui/QApplication>
#include <QtCore/QTextCodec>
#include "globalhotkey.h"
#include "stockinfo.h"

int main(int argc, char *argv[])
{
    GlobalHotkey hk(argc, argv);

    QTextCodec* code = QTextCodec::codecForName("gbk");
    QTextCodec::setCodecForTr(code);
    QTextCodec::setCodecForCStrings(code);

    StockInfo w;
    w.show();

    if(hk.registerHotKey(&w) > 0)
    {
        qApp->quit();
    }

    QObject::connect(&hk, SIGNAL(signalPressedHotkey(int)), &w,
                     SLOT(slotPressedHotkey(int)));

    return hk.exec();
}
